home *** CD-ROM | disk | FTP | other *** search
- /*
- File: "MPEntryPointTest.c"
-
- Description:
- This is a application to test the MP Entrypoints.
-
- Version: v0.0
-
- File Ownership:
-
- DRI: George Warner
-
- Other Contact:
-
- Technology: MultiTasking/MultiProcessing
-
- Copyright: © Copyright 2000 Apple Computer, Inc. All rights reserved.
-
- Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
- ("Apple") in consideration of your agreement to the following terms, and your
- use, installation, modification or redistribution of this Apple software
- constitutes acceptance of these terms. If you do not agree with these terms,
- please do not use, install, modify or redistribute this Apple software.
-
- In consideration of your agreement to abide by the following terms, and subject
- to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
- copyrights in this original Apple software (the "Apple Software"), to use,
- reproduce, modify and redistribute the Apple Software, with or without
- modifications, in source and/or binary forms; provided that if you redistribute
- the Apple Software in its entirety and without modifications, you must retain
- this notice and the following text and disclaimers in all such redistributions of
- the Apple Software. Neither the name, trademarks, service marks or logos of
- Apple Computer, Inc. may be used to endorse or promote products derived from the
- Apple Software without specific prior written permission from Apple. Except as
- expressly stated in this notice, no other rights or licenses, express or implied,
- are granted by Apple herein, including but not limited to any patent rights that
- may be infringed by your derivative works or by other works in which the Apple
- Software may be incorporated.
-
- The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
- WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
- WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
- COMBINATION WITH YOUR PRODUCTS.
-
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
- OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
- (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- Writers:
-
- gaw - George Warner
-
- Change History (most recent first):
-
- <1> 02/29/00 gaw Initial build
-
- Author Initials:
-
- gaw - George Warner
-
- */
-
- #pragma mark compiler directives
-
- #define DUMP_API_INFO(s) printf("%8.8lX: " #s ".\n",s)
-
- #pragma mark #Includes
- #include <MacTypes.h>
- #include <Events.h>
- #include <Fonts.h>
- #include <Multiprocessing.h>
-
- #include <stdio.h> // for printf & fflush
- #include <SIOUX.h> // for SIOUXSettings stuff
- #include <SIOUXGlobals.h> // for SIOUXQuitting
-
- #pragma mark typedefs, structs, enums, defines, etc.
-
- #pragma mark exported functions
- void main(void)
- {
- // Set the SIOUX window defaults
- SIOUXSettings.autocloseonquit = false;
- SIOUXSettings.asktosaveonclose = false;
- SIOUXSettings.showstatusline = false;
- SIOUXSettings.columns = 132;
- SIOUXSettings.rows = 24;
- SIOUXSettings.fontsize = 10;
- GetFNum("\pMonaco",&SIOUXSettings.fontid);
- SIOUXSettings.standalone = true;
-
- printf("MPEntryPointTest Starting!\n");
-
- // Make sure that the MP library is loaded
- if (!MPLibraryIsLoaded())
- printf("The MP library did not load.\n");
-
- { // for giggles we'll dump out the MP Library version info
- Ptr tVersionCStringPtr;
- UInt32 major,minor,release,revision;
-
- _MPLibraryVersion(&tVersionCStringPtr,&major,&minor,&release,&revision);
-
- printf("\n Version: \"%s\", major: %ld, minor: %ld, release: %ld, revision: %ld.\n",tVersionCStringPtr,major,minor,release,revision);
- }
-
- printf("\n");
-
- DUMP_API_INFO(AbsoluteToDuration);
- DUMP_API_INFO(DurationToAbsolute);
- DUMP_API_INFO(UpTime);
-
- DUMP_API_INFO(MPAllocate);
- DUMP_API_INFO(MPAllocateAligned);
- DUMP_API_INFO(MPAllocateTaskStorageIndex);
- DUMP_API_INFO(MPArmTimer);
- DUMP_API_INFO(MPBlockClear);
- DUMP_API_INFO(MPBlockCopy);
- DUMP_API_INFO(MPCancelTimer);
- DUMP_API_INFO(MPCauseNotification);
- DUMP_API_INFO(MPCreateCriticalRegion);
- DUMP_API_INFO(MPCreateEvent);
- DUMP_API_INFO(MPCreateNotification);
- DUMP_API_INFO(MPCreateQueue);
- DUMP_API_INFO(MPCreateSemaphore);
- DUMP_API_INFO(MPCreateTask);
- DUMP_API_INFO(MPCreateTimer);
- DUMP_API_INFO(MPCurrentTaskID);
- DUMP_API_INFO(MPDataToCode);
- DUMP_API_INFO(MPDeallocateTaskStorageIndex);
- DUMP_API_INFO(MPDelayUntil);
- DUMP_API_INFO(MPDeleteCriticalRegion);
- DUMP_API_INFO(MPDeleteEvent);
- DUMP_API_INFO(MPDeleteNotification);
- DUMP_API_INFO(MPDeleteQueue);
- DUMP_API_INFO(MPDeleteSemaphore);
- DUMP_API_INFO(MPDeleteTimer);
- DUMP_API_INFO(MPDisposeTaskException);
- DUMP_API_INFO(MPEnterCriticalRegion);
- DUMP_API_INFO(MPExit);
- DUMP_API_INFO(MPExitCriticalRegion);
- DUMP_API_INFO(MPExtractTaskState);
- DUMP_API_INFO(MPFree);
- DUMP_API_INFO(MPGetAllocatedBlockSize);
- DUMP_API_INFO(MPGetNextCpuID);
- DUMP_API_INFO(MPGetNextTaskID);
- DUMP_API_INFO(MPGetTaskStorageValue);
- DUMP_API_INFO(MPModifyNotification);
- DUMP_API_INFO(MPNotifyQueue);
- DUMP_API_INFO(MPProcessors);
- DUMP_API_INFO(MPProcessorsScheduled);
- DUMP_API_INFO(MPRegisterDebugger);
- DUMP_API_INFO(MPRemoteCall);
- DUMP_API_INFO(MPSetEvent);
- DUMP_API_INFO(MPSetExceptionHandler);
- DUMP_API_INFO(MPSetQueueReserve);
- DUMP_API_INFO(MPSetTaskState);
- DUMP_API_INFO(MPSetTaskStorageValue);
- DUMP_API_INFO(MPSetTaskWeight);
- DUMP_API_INFO(MPSetTimerNotify);
- DUMP_API_INFO(MPSignalSemaphore);
- DUMP_API_INFO(MPTaskIsPreemptive);
- DUMP_API_INFO(MPTerminateTask);
- DUMP_API_INFO(MPThrowException);
- DUMP_API_INFO(MPUnregisterDebugger);
- DUMP_API_INFO(MPWaitForEvent);
- DUMP_API_INFO(MPWaitOnQueue);
- DUMP_API_INFO(MPWaitOnSemaphore);
- DUMP_API_INFO(MPYield);
-
- // DUMP_API_INFO(_MPAllocateSys);
- // DUMP_API_INFO(_MPDebugStr);
- // DUMP_API_INFO(_MPInitializePrintf);
- DUMP_API_INFO(_MPIsFullyInitialized);
- DUMP_API_INFO(_MPLibraryIsCompatible);
- DUMP_API_INFO(_MPLibraryVersion);
- // DUMP_API_INFO(_MPPrintf);
- // DUMP_API_INFO(_MPRPC);
- // DUMP_API_INFO(_MPStatusCString);
- // DUMP_API_INFO(_MPStatusPString);
- // DUMP_API_INFO(_MPTaskIsToolboxSafe);
-
- printf("Done!\nPress command-Q to quit.\n");
- }
-